<%--
  Created by IntelliJ IDEA.
  User: YKMZ
  Date: 2022/9/22
  Time: 20:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>甜品列表</title>
    <%-- 1. 引入jquery--%>
    <script src="webjars/jquery/3.6.1/dist/jquery.min.js"></script>
    <%-- 2. 引入bootstrap的css样式--%>
    <link rel="stylesheet" href="webjars/bootstrap/3.4.1/dist/css/bootstrap.min.css">
    <%-- 3. 引入bootstrap的js样式--%>
    <script src="webjars/bootstrap/3.4.1/dist/js/bootstrap.min.js"></script>
    <style>
        .container{
            margin-top: 10px;
        }
        .table{
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <h3>所有甜品列表</h3>
                </h3>
            </div>
            <table class="table table-bordered table-hover" >
                <tr>
                    <td>甜品ID</td>
                    <td>甜品名称</td>
                    <td>单价</td>
                    <td>库存量</td>
                    <td>操作</td>
                </tr>
                <c:forEach items="${desserts}" var="d">
                <tr>
                    <td>${d.value.did}</td>
                    <td>${d.value.dname}</td>
                    <td>${d.value.price}</td>
                    <td>${d.value.quantity}</td>
                    <td>
                        <a href="/cart?cmd=add&did=${d.value.did}" class="btn btn-default sm">购买</a>
                    </td>
                </tr>
                </c:forEach>
            </table>
            <div class="panel-footer text-right">
                百年智2022.
            </div>
        </div>
    </div>
</body>
</html>
